<?php


abstract class BaseCpHotRbt extends BaseObject  implements Persistent {


	
	protected static $peer;


	
	protected $id;


	
	protected $cp_id;


	
	protected $cp_code;


	
	protected $cp_name;


	
	protected $check_time;


	
	protected $content_language;


	
	protected $rbt_index;


	
	protected $language;


	
	protected $music_id;


	
	protected $order_times;


	
	protected $price;


	
	protected $price_group_id;


	
	protected $relative_time;


	
	protected $set_times;


	
	protected $singer_name;


	
	protected $singer_name_letter;


	
	protected $singer_sex;


	
	protected $status;


	
	protected $table_type;


	
	protected $tone_address;


	
	protected $tone_code;


	
	protected $tone_code_long;


	
	protected $tone_id;


	
	protected $tone_name;


	
	protected $tone_name_letter;


	
	protected $tone_path;


	
	protected $tone_pre_listen_address;


	
	protected $tone_pre_listen_path;


	
	protected $tone_valid_day;


	
	protected $update_time;


	
	protected $upload_time;


	
	protected $upload_type;

	
	protected $alreadyInSave = false;

	
	protected $alreadyInValidation = false;

	
	public function getId()
	{

		return $this->id;
	}

	
	public function getCpId()
	{

		return $this->cp_id;
	}

	
	public function getCpCode()
	{

		return $this->cp_code;
	}

	
	public function getCpName()
	{

		return $this->cp_name;
	}

	
	public function getCheckTime($format = 'Y-m-d H:i:s')
	{

		if ($this->check_time === null || $this->check_time === '') {
			return null;
		} elseif (!is_int($this->check_time)) {
						$ts = strtotime($this->check_time);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse value of [check_time] as date/time value: " . var_export($this->check_time, true));
			}
		} else {
			$ts = $this->check_time;
		}
		if ($format === null) {
			return $ts;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $ts);
		} else {
			return date($format, $ts);
		}
	}

	
	public function getContentLanguage()
	{

		return $this->content_language;
	}

	
	public function getRbtIndex()
	{

		return $this->rbt_index;
	}

	
	public function getLanguage()
	{

		return $this->language;
	}

	
	public function getMusicId()
	{

		return $this->music_id;
	}

	
	public function getOrderTimes()
	{

		return $this->order_times;
	}

	
	public function getPrice()
	{

		return $this->price;
	}

	
	public function getPriceGroupId()
	{

		return $this->price_group_id;
	}

	
	public function getRelativeTime()
	{

		return $this->relative_time;
	}

	
	public function getSetTimes()
	{

		return $this->set_times;
	}

	
	public function getSingerName()
	{

		return $this->singer_name;
	}

	
	public function getSingerNameLetter()
	{

		return $this->singer_name_letter;
	}

	
	public function getSingerSex()
	{

		return $this->singer_sex;
	}

	
	public function getStatus()
	{

		return $this->status;
	}

	
	public function getTableType()
	{

		return $this->table_type;
	}

	
	public function getToneAddress()
	{

		return $this->tone_address;
	}

	
	public function getToneCode()
	{

		return $this->tone_code;
	}

	
	public function getToneCodeLong()
	{

		return $this->tone_code_long;
	}

	
	public function getToneId()
	{

		return $this->tone_id;
	}

	
	public function getToneName()
	{

		return $this->tone_name;
	}

	
	public function getToneNameLetter()
	{

		return $this->tone_name_letter;
	}

	
	public function getTonePath()
	{

		return $this->tone_path;
	}

	
	public function getTonePreListenAddress()
	{

		return $this->tone_pre_listen_address;
	}

	
	public function getTonePreListenPath()
	{

		return $this->tone_pre_listen_path;
	}

	
	public function getToneValidDay($format = 'Y-m-d H:i:s')
	{

		if ($this->tone_valid_day === null || $this->tone_valid_day === '') {
			return null;
		} elseif (!is_int($this->tone_valid_day)) {
						$ts = strtotime($this->tone_valid_day);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse value of [tone_valid_day] as date/time value: " . var_export($this->tone_valid_day, true));
			}
		} else {
			$ts = $this->tone_valid_day;
		}
		if ($format === null) {
			return $ts;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $ts);
		} else {
			return date($format, $ts);
		}
	}

	
	public function getUpdateTime($format = 'Y-m-d H:i:s')
	{

		if ($this->update_time === null || $this->update_time === '') {
			return null;
		} elseif (!is_int($this->update_time)) {
						$ts = strtotime($this->update_time);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse value of [update_time] as date/time value: " . var_export($this->update_time, true));
			}
		} else {
			$ts = $this->update_time;
		}
		if ($format === null) {
			return $ts;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $ts);
		} else {
			return date($format, $ts);
		}
	}

	
	public function getUploadTime($format = 'Y-m-d H:i:s')
	{

		if ($this->upload_time === null || $this->upload_time === '') {
			return null;
		} elseif (!is_int($this->upload_time)) {
						$ts = strtotime($this->upload_time);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse value of [upload_time] as date/time value: " . var_export($this->upload_time, true));
			}
		} else {
			$ts = $this->upload_time;
		}
		if ($format === null) {
			return $ts;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $ts);
		} else {
			return date($format, $ts);
		}
	}

	
	public function getUploadType()
	{

		return $this->upload_type;
	}

	
	public function setId($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->id !== $v) {
			$this->id = $v;
			$this->modifiedColumns[] = CpHotRbtPeer::ID;
		}

	} 
	
	public function setCpId($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->cp_id !== $v) {
			$this->cp_id = $v;
			$this->modifiedColumns[] = CpHotRbtPeer::CP_ID;
		}

	} 
	
	public function setCpCode($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->cp_code !== $v) {
			$this->cp_code = $v;
			$this->modifiedColumns[] = CpHotRbtPeer::CP_CODE;
		}

	} 
	
	public function setCpName($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->cp_name !== $v) {
			$this->cp_name = $v;
			$this->modifiedColumns[] = CpHotRbtPeer::CP_NAME;
		}

	} 
	
	public function setCheckTime($v)
	{

		if ($v !== null && !is_int($v)) {
			$ts = strtotime($v);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse date/time value for [check_time] from input: " . var_export($v, true));
			}
		} else {
			$ts = $v;
		}
		if ($this->check_time !== $ts) {
			$this->check_time = $ts;
			$this->modifiedColumns[] = CpHotRbtPeer::CHECK_TIME;
		}

	} 
	
	public function setContentLanguage($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->content_language !== $v) {
			$this->content_language = $v;
			$this->modifiedColumns[] = CpHotRbtPeer::CONTENT_LANGUAGE;
		}

	} 
	
	public function setRbtIndex($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->rbt_index !== $v) {
			$this->rbt_index = $v;
			$this->modifiedColumns[] = CpHotRbtPeer::RBT_INDEX;
		}

	} 
	
	public function setLanguage($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->language !== $v) {
			$this->language = $v;
			$this->modifiedColumns[] = CpHotRbtPeer::LANGUAGE;
		}

	} 
	
	public function setMusicId($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->music_id !== $v) {
			$this->music_id = $v;
			$this->modifiedColumns[] = CpHotRbtPeer::MUSIC_ID;
		}

	} 
	
	public function setOrderTimes($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->order_times !== $v) {
			$this->order_times = $v;
			$this->modifiedColumns[] = CpHotRbtPeer::ORDER_TIMES;
		}

	} 
	
	public function setPrice($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->price !== $v) {
			$this->price = $v;
			$this->modifiedColumns[] = CpHotRbtPeer::PRICE;
		}

	} 
	
	public function setPriceGroupId($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->price_group_id !== $v) {
			$this->price_group_id = $v;
			$this->modifiedColumns[] = CpHotRbtPeer::PRICE_GROUP_ID;
		}

	} 
	
	public function setRelativeTime($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->relative_time !== $v) {
			$this->relative_time = $v;
			$this->modifiedColumns[] = CpHotRbtPeer::RELATIVE_TIME;
		}

	} 
	
	public function setSetTimes($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->set_times !== $v) {
			$this->set_times = $v;
			$this->modifiedColumns[] = CpHotRbtPeer::SET_TIMES;
		}

	} 
	
	public function setSingerName($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->singer_name !== $v) {
			$this->singer_name = $v;
			$this->modifiedColumns[] = CpHotRbtPeer::SINGER_NAME;
		}

	} 
	
	public function setSingerNameLetter($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->singer_name_letter !== $v) {
			$this->singer_name_letter = $v;
			$this->modifiedColumns[] = CpHotRbtPeer::SINGER_NAME_LETTER;
		}

	} 
	
	public function setSingerSex($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->singer_sex !== $v) {
			$this->singer_sex = $v;
			$this->modifiedColumns[] = CpHotRbtPeer::SINGER_SEX;
		}

	} 
	
	public function setStatus($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->status !== $v) {
			$this->status = $v;
			$this->modifiedColumns[] = CpHotRbtPeer::STATUS;
		}

	} 
	
	public function setTableType($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->table_type !== $v) {
			$this->table_type = $v;
			$this->modifiedColumns[] = CpHotRbtPeer::TABLE_TYPE;
		}

	} 
	
	public function setToneAddress($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->tone_address !== $v) {
			$this->tone_address = $v;
			$this->modifiedColumns[] = CpHotRbtPeer::TONE_ADDRESS;
		}

	} 
	
	public function setToneCode($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->tone_code !== $v) {
			$this->tone_code = $v;
			$this->modifiedColumns[] = CpHotRbtPeer::TONE_CODE;
		}

	} 
	
	public function setToneCodeLong($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->tone_code_long !== $v) {
			$this->tone_code_long = $v;
			$this->modifiedColumns[] = CpHotRbtPeer::TONE_CODE_LONG;
		}

	} 
	
	public function setToneId($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->tone_id !== $v) {
			$this->tone_id = $v;
			$this->modifiedColumns[] = CpHotRbtPeer::TONE_ID;
		}

	} 
	
	public function setToneName($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->tone_name !== $v) {
			$this->tone_name = $v;
			$this->modifiedColumns[] = CpHotRbtPeer::TONE_NAME;
		}

	} 
	
	public function setToneNameLetter($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->tone_name_letter !== $v) {
			$this->tone_name_letter = $v;
			$this->modifiedColumns[] = CpHotRbtPeer::TONE_NAME_LETTER;
		}

	} 
	
	public function setTonePath($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->tone_path !== $v) {
			$this->tone_path = $v;
			$this->modifiedColumns[] = CpHotRbtPeer::TONE_PATH;
		}

	} 
	
	public function setTonePreListenAddress($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->tone_pre_listen_address !== $v) {
			$this->tone_pre_listen_address = $v;
			$this->modifiedColumns[] = CpHotRbtPeer::TONE_PRE_LISTEN_ADDRESS;
		}

	} 
	
	public function setTonePreListenPath($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->tone_pre_listen_path !== $v) {
			$this->tone_pre_listen_path = $v;
			$this->modifiedColumns[] = CpHotRbtPeer::TONE_PRE_LISTEN_PATH;
		}

	} 
	
	public function setToneValidDay($v)
	{

		if ($v !== null && !is_int($v)) {
			$ts = strtotime($v);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse date/time value for [tone_valid_day] from input: " . var_export($v, true));
			}
		} else {
			$ts = $v;
		}
		if ($this->tone_valid_day !== $ts) {
			$this->tone_valid_day = $ts;
			$this->modifiedColumns[] = CpHotRbtPeer::TONE_VALID_DAY;
		}

	} 
	
	public function setUpdateTime($v)
	{

		if ($v !== null && !is_int($v)) {
			$ts = strtotime($v);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse date/time value for [update_time] from input: " . var_export($v, true));
			}
		} else {
			$ts = $v;
		}
		if ($this->update_time !== $ts) {
			$this->update_time = $ts;
			$this->modifiedColumns[] = CpHotRbtPeer::UPDATE_TIME;
		}

	} 
	
	public function setUploadTime($v)
	{

		if ($v !== null && !is_int($v)) {
			$ts = strtotime($v);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse date/time value for [upload_time] from input: " . var_export($v, true));
			}
		} else {
			$ts = $v;
		}
		if ($this->upload_time !== $ts) {
			$this->upload_time = $ts;
			$this->modifiedColumns[] = CpHotRbtPeer::UPLOAD_TIME;
		}

	} 
	
	public function setUploadType($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->upload_type !== $v) {
			$this->upload_type = $v;
			$this->modifiedColumns[] = CpHotRbtPeer::UPLOAD_TYPE;
		}

	} 
	
	public function hydrate(ResultSet $rs, $startcol = 1)
	{
		try {

			$this->id = $rs->getInt($startcol + 0);

			$this->cp_id = $rs->getString($startcol + 1);

			$this->cp_code = $rs->getString($startcol + 2);

			$this->cp_name = $rs->getString($startcol + 3);

			$this->check_time = $rs->getTimestamp($startcol + 4, null);

			$this->content_language = $rs->getString($startcol + 5);

			$this->rbt_index = $rs->getString($startcol + 6);

			$this->language = $rs->getString($startcol + 7);

			$this->music_id = $rs->getString($startcol + 8);

			$this->order_times = $rs->getString($startcol + 9);

			$this->price = $rs->getString($startcol + 10);

			$this->price_group_id = $rs->getString($startcol + 11);

			$this->relative_time = $rs->getString($startcol + 12);

			$this->set_times = $rs->getString($startcol + 13);

			$this->singer_name = $rs->getString($startcol + 14);

			$this->singer_name_letter = $rs->getString($startcol + 15);

			$this->singer_sex = $rs->getString($startcol + 16);

			$this->status = $rs->getString($startcol + 17);

			$this->table_type = $rs->getString($startcol + 18);

			$this->tone_address = $rs->getString($startcol + 19);

			$this->tone_code = $rs->getString($startcol + 20);

			$this->tone_code_long = $rs->getString($startcol + 21);

			$this->tone_id = $rs->getString($startcol + 22);

			$this->tone_name = $rs->getString($startcol + 23);

			$this->tone_name_letter = $rs->getString($startcol + 24);

			$this->tone_path = $rs->getString($startcol + 25);

			$this->tone_pre_listen_address = $rs->getString($startcol + 26);

			$this->tone_pre_listen_path = $rs->getString($startcol + 27);

			$this->tone_valid_day = $rs->getTimestamp($startcol + 28, null);

			$this->update_time = $rs->getTimestamp($startcol + 29, null);

			$this->upload_time = $rs->getTimestamp($startcol + 30, null);

			$this->upload_type = $rs->getString($startcol + 31);

			$this->resetModified();

			$this->setNew(false);

						return $startcol + 32; 
		} catch (Exception $e) {
			throw new PropelException("Error populating CpHotRbt object", $e);
		}
	}

	
	public function delete($con = null)
	{
		if ($this->isDeleted()) {
			throw new PropelException("This object has already been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(CpHotRbtPeer::DATABASE_NAME);
		}

		try {
			$con->begin();
			CpHotRbtPeer::doDelete($this, $con);
			$this->setDeleted(true);
			$con->commit();
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	public function save($con = null)
	{
		if ($this->isDeleted()) {
			throw new PropelException("You cannot save an object that has been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(CpHotRbtPeer::DATABASE_NAME);
		}

		try {
			$con->begin();
			$affectedRows = $this->doSave($con);
			$con->commit();
			return $affectedRows;
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	protected function doSave($con)
	{
		$affectedRows = 0; 		if (!$this->alreadyInSave) {
			$this->alreadyInSave = true;


						if ($this->isModified()) {
				if ($this->isNew()) {
					$pk = CpHotRbtPeer::doInsert($this, $con);
					$affectedRows += 1; 										 										 
					$this->setId($pk);  
					$this->setNew(false);
				} else {
					$affectedRows += CpHotRbtPeer::doUpdate($this, $con);
				}
				$this->resetModified(); 			}

			$this->alreadyInSave = false;
		}
		return $affectedRows;
	} 
	
	protected $validationFailures = array();

	
	public function getValidationFailures()
	{
		return $this->validationFailures;
	}

	
	public function validate($columns = null)
	{
		$res = $this->doValidate($columns);
		if ($res === true) {
			$this->validationFailures = array();
			return true;
		} else {
			$this->validationFailures = $res;
			return false;
		}
	}

	
	protected function doValidate($columns = null)
	{
		if (!$this->alreadyInValidation) {
			$this->alreadyInValidation = true;
			$retval = null;

			$failureMap = array();


			if (($retval = CpHotRbtPeer::doValidate($this, $columns)) !== true) {
				$failureMap = array_merge($failureMap, $retval);
			}



			$this->alreadyInValidation = false;
		}

		return (!empty($failureMap) ? $failureMap : true);
	}

	
	public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = CpHotRbtPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->getByPosition($pos);
	}

	
	public function getByPosition($pos)
	{
		switch($pos) {
			case 0:
				return $this->getId();
				break;
			case 1:
				return $this->getCpId();
				break;
			case 2:
				return $this->getCpCode();
				break;
			case 3:
				return $this->getCpName();
				break;
			case 4:
				return $this->getCheckTime();
				break;
			case 5:
				return $this->getContentLanguage();
				break;
			case 6:
				return $this->getRbtIndex();
				break;
			case 7:
				return $this->getLanguage();
				break;
			case 8:
				return $this->getMusicId();
				break;
			case 9:
				return $this->getOrderTimes();
				break;
			case 10:
				return $this->getPrice();
				break;
			case 11:
				return $this->getPriceGroupId();
				break;
			case 12:
				return $this->getRelativeTime();
				break;
			case 13:
				return $this->getSetTimes();
				break;
			case 14:
				return $this->getSingerName();
				break;
			case 15:
				return $this->getSingerNameLetter();
				break;
			case 16:
				return $this->getSingerSex();
				break;
			case 17:
				return $this->getStatus();
				break;
			case 18:
				return $this->getTableType();
				break;
			case 19:
				return $this->getToneAddress();
				break;
			case 20:
				return $this->getToneCode();
				break;
			case 21:
				return $this->getToneCodeLong();
				break;
			case 22:
				return $this->getToneId();
				break;
			case 23:
				return $this->getToneName();
				break;
			case 24:
				return $this->getToneNameLetter();
				break;
			case 25:
				return $this->getTonePath();
				break;
			case 26:
				return $this->getTonePreListenAddress();
				break;
			case 27:
				return $this->getTonePreListenPath();
				break;
			case 28:
				return $this->getToneValidDay();
				break;
			case 29:
				return $this->getUpdateTime();
				break;
			case 30:
				return $this->getUploadTime();
				break;
			case 31:
				return $this->getUploadType();
				break;
			default:
				return null;
				break;
		} 	}

	
	public function toArray($keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = CpHotRbtPeer::getFieldNames($keyType);
		$result = array(
			$keys[0] => $this->getId(),
			$keys[1] => $this->getCpId(),
			$keys[2] => $this->getCpCode(),
			$keys[3] => $this->getCpName(),
			$keys[4] => $this->getCheckTime(),
			$keys[5] => $this->getContentLanguage(),
			$keys[6] => $this->getRbtIndex(),
			$keys[7] => $this->getLanguage(),
			$keys[8] => $this->getMusicId(),
			$keys[9] => $this->getOrderTimes(),
			$keys[10] => $this->getPrice(),
			$keys[11] => $this->getPriceGroupId(),
			$keys[12] => $this->getRelativeTime(),
			$keys[13] => $this->getSetTimes(),
			$keys[14] => $this->getSingerName(),
			$keys[15] => $this->getSingerNameLetter(),
			$keys[16] => $this->getSingerSex(),
			$keys[17] => $this->getStatus(),
			$keys[18] => $this->getTableType(),
			$keys[19] => $this->getToneAddress(),
			$keys[20] => $this->getToneCode(),
			$keys[21] => $this->getToneCodeLong(),
			$keys[22] => $this->getToneId(),
			$keys[23] => $this->getToneName(),
			$keys[24] => $this->getToneNameLetter(),
			$keys[25] => $this->getTonePath(),
			$keys[26] => $this->getTonePreListenAddress(),
			$keys[27] => $this->getTonePreListenPath(),
			$keys[28] => $this->getToneValidDay(),
			$keys[29] => $this->getUpdateTime(),
			$keys[30] => $this->getUploadTime(),
			$keys[31] => $this->getUploadType(),
		);
		return $result;
	}

	
	public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = CpHotRbtPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->setByPosition($pos, $value);
	}

	
	public function setByPosition($pos, $value)
	{
		switch($pos) {
			case 0:
				$this->setId($value);
				break;
			case 1:
				$this->setCpId($value);
				break;
			case 2:
				$this->setCpCode($value);
				break;
			case 3:
				$this->setCpName($value);
				break;
			case 4:
				$this->setCheckTime($value);
				break;
			case 5:
				$this->setContentLanguage($value);
				break;
			case 6:
				$this->setRbtIndex($value);
				break;
			case 7:
				$this->setLanguage($value);
				break;
			case 8:
				$this->setMusicId($value);
				break;
			case 9:
				$this->setOrderTimes($value);
				break;
			case 10:
				$this->setPrice($value);
				break;
			case 11:
				$this->setPriceGroupId($value);
				break;
			case 12:
				$this->setRelativeTime($value);
				break;
			case 13:
				$this->setSetTimes($value);
				break;
			case 14:
				$this->setSingerName($value);
				break;
			case 15:
				$this->setSingerNameLetter($value);
				break;
			case 16:
				$this->setSingerSex($value);
				break;
			case 17:
				$this->setStatus($value);
				break;
			case 18:
				$this->setTableType($value);
				break;
			case 19:
				$this->setToneAddress($value);
				break;
			case 20:
				$this->setToneCode($value);
				break;
			case 21:
				$this->setToneCodeLong($value);
				break;
			case 22:
				$this->setToneId($value);
				break;
			case 23:
				$this->setToneName($value);
				break;
			case 24:
				$this->setToneNameLetter($value);
				break;
			case 25:
				$this->setTonePath($value);
				break;
			case 26:
				$this->setTonePreListenAddress($value);
				break;
			case 27:
				$this->setTonePreListenPath($value);
				break;
			case 28:
				$this->setToneValidDay($value);
				break;
			case 29:
				$this->setUpdateTime($value);
				break;
			case 30:
				$this->setUploadTime($value);
				break;
			case 31:
				$this->setUploadType($value);
				break;
		} 	}

	
	public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = CpHotRbtPeer::getFieldNames($keyType);

		if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
		if (array_key_exists($keys[1], $arr)) $this->setCpId($arr[$keys[1]]);
		if (array_key_exists($keys[2], $arr)) $this->setCpCode($arr[$keys[2]]);
		if (array_key_exists($keys[3], $arr)) $this->setCpName($arr[$keys[3]]);
		if (array_key_exists($keys[4], $arr)) $this->setCheckTime($arr[$keys[4]]);
		if (array_key_exists($keys[5], $arr)) $this->setContentLanguage($arr[$keys[5]]);
		if (array_key_exists($keys[6], $arr)) $this->setRbtIndex($arr[$keys[6]]);
		if (array_key_exists($keys[7], $arr)) $this->setLanguage($arr[$keys[7]]);
		if (array_key_exists($keys[8], $arr)) $this->setMusicId($arr[$keys[8]]);
		if (array_key_exists($keys[9], $arr)) $this->setOrderTimes($arr[$keys[9]]);
		if (array_key_exists($keys[10], $arr)) $this->setPrice($arr[$keys[10]]);
		if (array_key_exists($keys[11], $arr)) $this->setPriceGroupId($arr[$keys[11]]);
		if (array_key_exists($keys[12], $arr)) $this->setRelativeTime($arr[$keys[12]]);
		if (array_key_exists($keys[13], $arr)) $this->setSetTimes($arr[$keys[13]]);
		if (array_key_exists($keys[14], $arr)) $this->setSingerName($arr[$keys[14]]);
		if (array_key_exists($keys[15], $arr)) $this->setSingerNameLetter($arr[$keys[15]]);
		if (array_key_exists($keys[16], $arr)) $this->setSingerSex($arr[$keys[16]]);
		if (array_key_exists($keys[17], $arr)) $this->setStatus($arr[$keys[17]]);
		if (array_key_exists($keys[18], $arr)) $this->setTableType($arr[$keys[18]]);
		if (array_key_exists($keys[19], $arr)) $this->setToneAddress($arr[$keys[19]]);
		if (array_key_exists($keys[20], $arr)) $this->setToneCode($arr[$keys[20]]);
		if (array_key_exists($keys[21], $arr)) $this->setToneCodeLong($arr[$keys[21]]);
		if (array_key_exists($keys[22], $arr)) $this->setToneId($arr[$keys[22]]);
		if (array_key_exists($keys[23], $arr)) $this->setToneName($arr[$keys[23]]);
		if (array_key_exists($keys[24], $arr)) $this->setToneNameLetter($arr[$keys[24]]);
		if (array_key_exists($keys[25], $arr)) $this->setTonePath($arr[$keys[25]]);
		if (array_key_exists($keys[26], $arr)) $this->setTonePreListenAddress($arr[$keys[26]]);
		if (array_key_exists($keys[27], $arr)) $this->setTonePreListenPath($arr[$keys[27]]);
		if (array_key_exists($keys[28], $arr)) $this->setToneValidDay($arr[$keys[28]]);
		if (array_key_exists($keys[29], $arr)) $this->setUpdateTime($arr[$keys[29]]);
		if (array_key_exists($keys[30], $arr)) $this->setUploadTime($arr[$keys[30]]);
		if (array_key_exists($keys[31], $arr)) $this->setUploadType($arr[$keys[31]]);
	}

	
	public function buildCriteria()
	{
		$criteria = new Criteria(CpHotRbtPeer::DATABASE_NAME);

		if ($this->isColumnModified(CpHotRbtPeer::ID)) $criteria->add(CpHotRbtPeer::ID, $this->id);
		if ($this->isColumnModified(CpHotRbtPeer::CP_ID)) $criteria->add(CpHotRbtPeer::CP_ID, $this->cp_id);
		if ($this->isColumnModified(CpHotRbtPeer::CP_CODE)) $criteria->add(CpHotRbtPeer::CP_CODE, $this->cp_code);
		if ($this->isColumnModified(CpHotRbtPeer::CP_NAME)) $criteria->add(CpHotRbtPeer::CP_NAME, $this->cp_name);
		if ($this->isColumnModified(CpHotRbtPeer::CHECK_TIME)) $criteria->add(CpHotRbtPeer::CHECK_TIME, $this->check_time);
		if ($this->isColumnModified(CpHotRbtPeer::CONTENT_LANGUAGE)) $criteria->add(CpHotRbtPeer::CONTENT_LANGUAGE, $this->content_language);
		if ($this->isColumnModified(CpHotRbtPeer::RBT_INDEX)) $criteria->add(CpHotRbtPeer::RBT_INDEX, $this->rbt_index);
		if ($this->isColumnModified(CpHotRbtPeer::LANGUAGE)) $criteria->add(CpHotRbtPeer::LANGUAGE, $this->language);
		if ($this->isColumnModified(CpHotRbtPeer::MUSIC_ID)) $criteria->add(CpHotRbtPeer::MUSIC_ID, $this->music_id);
		if ($this->isColumnModified(CpHotRbtPeer::ORDER_TIMES)) $criteria->add(CpHotRbtPeer::ORDER_TIMES, $this->order_times);
		if ($this->isColumnModified(CpHotRbtPeer::PRICE)) $criteria->add(CpHotRbtPeer::PRICE, $this->price);
		if ($this->isColumnModified(CpHotRbtPeer::PRICE_GROUP_ID)) $criteria->add(CpHotRbtPeer::PRICE_GROUP_ID, $this->price_group_id);
		if ($this->isColumnModified(CpHotRbtPeer::RELATIVE_TIME)) $criteria->add(CpHotRbtPeer::RELATIVE_TIME, $this->relative_time);
		if ($this->isColumnModified(CpHotRbtPeer::SET_TIMES)) $criteria->add(CpHotRbtPeer::SET_TIMES, $this->set_times);
		if ($this->isColumnModified(CpHotRbtPeer::SINGER_NAME)) $criteria->add(CpHotRbtPeer::SINGER_NAME, $this->singer_name);
		if ($this->isColumnModified(CpHotRbtPeer::SINGER_NAME_LETTER)) $criteria->add(CpHotRbtPeer::SINGER_NAME_LETTER, $this->singer_name_letter);
		if ($this->isColumnModified(CpHotRbtPeer::SINGER_SEX)) $criteria->add(CpHotRbtPeer::SINGER_SEX, $this->singer_sex);
		if ($this->isColumnModified(CpHotRbtPeer::STATUS)) $criteria->add(CpHotRbtPeer::STATUS, $this->status);
		if ($this->isColumnModified(CpHotRbtPeer::TABLE_TYPE)) $criteria->add(CpHotRbtPeer::TABLE_TYPE, $this->table_type);
		if ($this->isColumnModified(CpHotRbtPeer::TONE_ADDRESS)) $criteria->add(CpHotRbtPeer::TONE_ADDRESS, $this->tone_address);
		if ($this->isColumnModified(CpHotRbtPeer::TONE_CODE)) $criteria->add(CpHotRbtPeer::TONE_CODE, $this->tone_code);
		if ($this->isColumnModified(CpHotRbtPeer::TONE_CODE_LONG)) $criteria->add(CpHotRbtPeer::TONE_CODE_LONG, $this->tone_code_long);
		if ($this->isColumnModified(CpHotRbtPeer::TONE_ID)) $criteria->add(CpHotRbtPeer::TONE_ID, $this->tone_id);
		if ($this->isColumnModified(CpHotRbtPeer::TONE_NAME)) $criteria->add(CpHotRbtPeer::TONE_NAME, $this->tone_name);
		if ($this->isColumnModified(CpHotRbtPeer::TONE_NAME_LETTER)) $criteria->add(CpHotRbtPeer::TONE_NAME_LETTER, $this->tone_name_letter);
		if ($this->isColumnModified(CpHotRbtPeer::TONE_PATH)) $criteria->add(CpHotRbtPeer::TONE_PATH, $this->tone_path);
		if ($this->isColumnModified(CpHotRbtPeer::TONE_PRE_LISTEN_ADDRESS)) $criteria->add(CpHotRbtPeer::TONE_PRE_LISTEN_ADDRESS, $this->tone_pre_listen_address);
		if ($this->isColumnModified(CpHotRbtPeer::TONE_PRE_LISTEN_PATH)) $criteria->add(CpHotRbtPeer::TONE_PRE_LISTEN_PATH, $this->tone_pre_listen_path);
		if ($this->isColumnModified(CpHotRbtPeer::TONE_VALID_DAY)) $criteria->add(CpHotRbtPeer::TONE_VALID_DAY, $this->tone_valid_day);
		if ($this->isColumnModified(CpHotRbtPeer::UPDATE_TIME)) $criteria->add(CpHotRbtPeer::UPDATE_TIME, $this->update_time);
		if ($this->isColumnModified(CpHotRbtPeer::UPLOAD_TIME)) $criteria->add(CpHotRbtPeer::UPLOAD_TIME, $this->upload_time);
		if ($this->isColumnModified(CpHotRbtPeer::UPLOAD_TYPE)) $criteria->add(CpHotRbtPeer::UPLOAD_TYPE, $this->upload_type);

		return $criteria;
	}

	
	public function buildPkeyCriteria()
	{
		$criteria = new Criteria(CpHotRbtPeer::DATABASE_NAME);

		$criteria->add(CpHotRbtPeer::ID, $this->id);

		return $criteria;
	}

	
	public function getPrimaryKey()
	{
		return $this->getId();
	}

	
	public function setPrimaryKey($key)
	{
		$this->setId($key);
	}

	
	public function copyInto($copyObj, $deepCopy = false)
	{

		$copyObj->setCpId($this->cp_id);

		$copyObj->setCpCode($this->cp_code);

		$copyObj->setCpName($this->cp_name);

		$copyObj->setCheckTime($this->check_time);

		$copyObj->setContentLanguage($this->content_language);

		$copyObj->setRbtIndex($this->rbt_index);

		$copyObj->setLanguage($this->language);

		$copyObj->setMusicId($this->music_id);

		$copyObj->setOrderTimes($this->order_times);

		$copyObj->setPrice($this->price);

		$copyObj->setPriceGroupId($this->price_group_id);

		$copyObj->setRelativeTime($this->relative_time);

		$copyObj->setSetTimes($this->set_times);

		$copyObj->setSingerName($this->singer_name);

		$copyObj->setSingerNameLetter($this->singer_name_letter);

		$copyObj->setSingerSex($this->singer_sex);

		$copyObj->setStatus($this->status);

		$copyObj->setTableType($this->table_type);

		$copyObj->setToneAddress($this->tone_address);

		$copyObj->setToneCode($this->tone_code);

		$copyObj->setToneCodeLong($this->tone_code_long);

		$copyObj->setToneId($this->tone_id);

		$copyObj->setToneName($this->tone_name);

		$copyObj->setToneNameLetter($this->tone_name_letter);

		$copyObj->setTonePath($this->tone_path);

		$copyObj->setTonePreListenAddress($this->tone_pre_listen_address);

		$copyObj->setTonePreListenPath($this->tone_pre_listen_path);

		$copyObj->setToneValidDay($this->tone_valid_day);

		$copyObj->setUpdateTime($this->update_time);

		$copyObj->setUploadTime($this->upload_time);

		$copyObj->setUploadType($this->upload_type);


		$copyObj->setNew(true);

		$copyObj->setId(NULL); 
	}

	
	public function copy($deepCopy = false)
	{
				$clazz = get_class($this);
		$copyObj = new $clazz();
		$this->copyInto($copyObj, $deepCopy);
		return $copyObj;
	}

	
	public function getPeer()
	{
		if (self::$peer === null) {
			self::$peer = new CpHotRbtPeer();
		}
		return self::$peer;
	}

} 